cmake_minimum_required(VERSION 3.14)
project(gles_sample)

option(ENABLE_ARM "enable arm" off)

if(ENABLE_ARM)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Werror -Wall")
else()
    link_directories(/usr/lib/x86_64-linux-gnu)
    include_directories(/usr/local/include)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Werror -Wall -Wno-deprecated-declarations -fPIC")
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

add_executable(gles_sample
        ${CMAKE_CURRENT_SOURCE_DIR}/gles_sample.cc
        ${CMAKE_CURRENT_SOURCE_DIR}/egl_wrapper.cc
        ${CMAKE_CURRENT_SOURCE_DIR}/gl_wrapper.cc
        ${CMAKE_CURRENT_SOURCE_DIR}/gl_operator_add.cc)

if(ENABLE_ARM)
    target_link_libraries(gles_sample GLESv3 EGL)
else()
    target_link_libraries(gles_sample GLESv2 EGL)
endif()